package com.fdk.wms.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.fdk.wms.entity.Book;
import com.fdk.wms.mapper.BookMapper;
import com.fdk.wms.service.BookService;

@Service
@Primary
public class BookServiceImpl implements BookService{
    
    @Autowired
    private BookMapper bookMapper;

    @Override
    public List<Book> findAllBooks(){
        List<Book> books = bookMapper.findAllBooks();
        return books;

    }

    @Override
    @Transactional
    public void insertBook(Book book) {
        bookMapper.insertBook(book);

    }
}
